FASTPROC : Ultimate speed in copying text and graphics displays to the printer Program written by PP van Mierlo, c(0) 1990-1995 WHY USE FASTPROC ? Often in a program there comes a time you want to copy the contents of the display to the printer. Of course you may use the PrtScr key to accomplish this (if you want to make that process faster you should look into the FASTDUMP program). However, if you prefer to have more control, or don't want to have to wait for the user to hit a key, or want to send the printer output to a file, you may use the procedures supplied in the FASTPROC package. The procedures in FASTPROC are probably the fastest you'll see, so that's an added advantage. I have tested the procedures from Turbo Pascal, Turbo C, Borland C, MS Pascal (yes ...), and Quick Basic. Below I will describe all procedures in FASTPROC in turn, explaining the package's features in the process. The order in which the procedures are discussed is not alphabetical but (more or less) logical. First an overview of all procedures is given, with a very short description. Then follows a series of short example programs to give you a place to start. Then the actual dumping procedures are discussed. Then follow the general and hercules specific customizing procedures, which are discussed in the same order as the command line options in the FASTDUMP manual, so you can easily compare the two. OVERVIEW OF ALL PROCEDURES AND FUNCTIONS procedure PrintScreen; prints the contents of the current video screen function PrintScreen2Disk(var filename : string) : integer; creates a file that when copied to the printer will be a copy of the current video screen procedure FPSetDensity(which : dump_densities); set the printing density for graphics dumps function FPGetDensity : dump_densities; returns the printing density for graphics dumps procedure FPSetInvert(todoornottodo : boolean); instructs FASTPROC to invert or not invert black and white in graphics screen dumps function FPGetInvert : boolean; returns true if FASTPROC will invert black and white in graphics screen dumps procedure FPSetFormFeed(todoornottodo : boolean); instruct FASTPROC to issue or not issue a formfeed to the printer after a graphics screen dump function FPGetFormFeed : boolean; returns true if FASTPROC is to issue a formfeed to the printer after a graphics screen dump procedure FPSetPort(which : dump_ports); select which printer port to send output to function FPGetPort : dump_ports; returns which printer port output will be sent to procedure FPSetOrientation(which : dump_orientations); select the orientation of graphics dumps on the printer paper function FPGetOrientation : dump_orientations; returns the orientation of graphics dumps on the printer paper procedure FPSetShrink(which : dump_shrinkmode); select shrinking mode function FPGetShrink : dump_shrinkmode; returns the shrinking mode FASTPROC is currently using for horizontal dumps procedure FPSetCentered(todoornottodo : boolean); instruct FASTPROC to center or not center horizontal dumps on the printer paper function FPGetCentered : boolean; returns true if FASTPROC will center horizontal dumps on the printer paper procedure FPSetWindow(x0,y0,x1,y1 : word); limits the window that will be printed to part of the video screen procedure FPGetWindow(var x0,y0,x1,y1 : word); returns the window that will be printed procedure FPSetColour(which : dump_colourmodes); instruct FASTPROC to start or stop generating colour, 24pin, laser printer output function FPGetColour : dump_colourmodes; returns true if FASTPROC will generate or simulate colour output when dumping EGA graphics procedure FPSetEgamask(black,red,yellow,blue : word); instruct FASTPROC which colours to dump of the 16 EGA colours and which not to procedure FPGetEgamask(var black,red,yellow,blue : word); returns the colour masks that FASTPROC will use to determine which colours to dump of the 16 EGA colours and which not to procedure FPSetPatterns(patterns : pointer); sets patterns for 24pin dithering of EGA screens procedure FPGetPatterns(patterns : pointer); gets patterns that will be used for 24pin dithering of EGA screens procedure FPSetSkipcount(lowlimit : word); select the number of spaces above which graphics to space conversions should be used to compress data to be printed function FPGetSkipcount : word; returns the number of spaces above which graphics to space conversions will be used to compress data to be printed procedure FPSetCompressMode(mode : integer); select the type of compression used to minimize the amount of data sent to the printer when making a dump function FPGetCompressMode : integer; returns the compression mode currently used to minimize the amount of data sent to the printer when making a dump procedure FPSetCR(todoornottodo : boolean); instruct FASTPROC to issue or not issue a carriage return in addition to a line feed to start a new line function FPGetCR : boolean; returns true if FASTPROC is to issue a carriage return as well as a line feed to start a new line procedure FPSetNul(todoornottodo : boolean); to make FASTPROC ignore all calls to PrintScreen and PrintScreen2Disk until further order function FPGetNul : boolean; returns true if FASTPROC will ignore all calls to PrintScreen and PrintScreen2Disk until further order function FPGetOutputcount : word; returns the number of bytes sent to the printer or print file in the last screen dump function FPGetInterrupted : boolean; returns true if FASTPROC was interrupted by pressing the ESC key procedure FPSetText; instructs FASTPROC to assume Hercules display is in text mode function FPGetText : boolean; returns true if FASTPROC assumes Hercules display is in text mode (and analysis algorithm will not be used) procedure FPSetGraph; instructs FASTPROC to assume Hercules display is in graphics mode function FPGetGraph : boolean; returns if FASTPROC will assume Hercules display is in graphics mode procedure FPSetAuto(todoornottodo : boolean); instruct FASTPROC to use or not use its analysis algorithm to determine if text or graphics are being displayed on a hercules adaptor function FPGetAuto : boolean; returns true if FASTPROC will use its analysis algorithm to determine if text or graphics are being displayed on a hercules adaptor procedure FPSetPage(which : dump_pages); select which page to take data from on a hercules adaptor function FPGetPage : dump_pages; returns which page data are taken from on a hercules adaptor EXAMPLE PROGRAMS Turbo Pascal {This example program is written in Turbo Pascal. It by no means makes an exhaustive use of the procedures in FASTPROC. It is merely meant to get you up and running using a few very basic and simple procedures. The best way to go about things is still RYMF: Read Your Manual First (sometimes also pronounced RYFM, with a slightly different interpretation of the letter F) } program test(input,output); uses fastpr24; {this makes the dumping procedures available to you} {make sure that the file FASTPR24.TPU is in the current or EXE&TPU directory} var a : filetype; begin {main} {create a text or graphics screen} {the following lines are optional. They contain the most commonly used commands to modify the working of fastproc} FPSetWindow(leftX,highY,rightX,lowY); {set limited window} {e.g. FPSetWindow(41,1,80,12) to dump upper right quadrant} FPSetDensity(2); FPSetOrientation(dump_horizontal); {these settings produce very acceptable dumps, where the x-axis is the same as for normal text} PrintScreen; {print the screen} a := 'prn'; if PrintScreen2Disk(a)<>0 then {an error occurred}; end. Microsoft Pascal {$include:'fastproc.itf'} {this should be at the very top of your file. It makes the compiler read the file FASTPROC.ITF which contains definitions} program test(input,output); uses fastproc; var a : lstring(80); begin {create some output} FPSetWindow(41,1,80,12); PrintScreen; a:='prn'; if PrintScreen2Disk(a)<>0 then {some error}; end. When the program has been compiled, it should be linked with the files FASTPROC.OBJ and FASTPR23.OBJ, which are provided with FASTPROC. Turbo C, Microsoft C #include "fastproc.h" /* header file for FASTPROC */ void main () { FPSetWindow(1,12,40,25); PrintScreen(); } When the program has been compiled it should be linked with the file FASTPR23.OBJ, which is provided with the FASTPROC package. In Turbo C you may indicate that an object file is to be linked by creating a project file. Quick BASIC If you want to use the FASTPROC procedures in the Quick BASIC you first need to create a version of FASTPROC that can be called from within the Quick BASIC editor. To do this use LINK /Q FASTPR23,FASTPROC,,BQLB45; This will create a file FASTPROC.QLB, which can be used from within Quick BASIC. To do this, start the Quick BASIC environment as follows: QB /Lfastproc The /L option tells Quick BASIC to load the specified .QLB (Quick library) file. If you run the Quick BASIC compiler from the command line make sure to link the resulting object file with the object file FASTPR23.OBJ. The example program: ' $INCLUDE: 'QUIKPROC.BAS' ' the previous line loads the file QUIKPROC.BAS, which contains ' defines for use with FASTPROC. PRINT horizontal%, doubleDensity% SCREEN 2 '640*200 CGA screen PSET (319, 0) FOR x = 0 TO 199 y = 639 * .5 * (1 + SIN(x / 20)) LINE -(y, x) NEXT CALL FPSetOrientation(horizontal%) CALL FPSetDensity(doubleDensity%) CALL PrintScreen END OVERVIEW OF ALL PROCEDURES AND FUNCTIONS (detailed) -------------------------------------------------------- PrintScreen procedure -------------------------------------------------------- Function prints the contents of the current video screen Declaration in Pascal procedure PrintScreen; BASIC DECLARE SUB PrintScreen C void far pascal PrintScreen(); Result type Remarks when the ESC key is hit the dump is interrupted Restrictions if the printer is off-line nothing happens See also PrintScreen2Disk Example -------------------------------------------------------- PrintScreen2Disk function -------------------------------------------------------- Function creates a file that when copied to the printer will be a copy of the current video screen Declaration in Pascal function PrintScreen2Disk( vars filename : stringtype) : integer; BASIC DECLARE FUNCTION PrintScreen2Disk%(SEG filename$) C int far pascal PrintScreen2Disk(char far *filename); Result type integer Remarks PrintScreen2Disk will return 0 no error 1 not enough room on stack 2 could not create file (error in filename) 3 error while writing to file (disk full) When the ESC key is hit the dump is interrupted Restrictions See also PrintScreen Example (Pascal:) VAR FILENAME : STRING[80]; RESULT : INTEGER; BEGIN FILENAME:='TEST'; RESULT:=PRINTSCREEN2DISK(FILENAME) END. (BASIC:) FILENAME$="TEST" RESULT%=PRINTSCREEN2DISK%(FILENAME$) END (At DOS prompt:) COPY TEST PRN -------------------------------------------------------- FPSetDensity procedure -------------------------------------------------------- Function set the printing density for graphics dumps Declaration in Pascal procedure FPSetDensity(which : dump_densities); BASIC DECLARE SUB FPSetDensity(BYVAL which%) C void far pascal FPSetDensity( dump_densities which); Result type Remarks (Pascal:) type dump_densities=(singleDensity, doubleDensity,oddDensity,quadDensity); (BASIC:) the constants SINGLEDENSITY%, DOUBLEDENSITY%, ODDDENSITY%, QUADDENSITY% have been assigned the appropriate values (C:) typedef enum { <>, singleDensity, doubleDensity, oddDensity, quadDensity } dump_densities; You should rarely want to use anything else than single density dumping, as the loss in speed is not made up for by the increase in quality when using higher densities. An exception to this occurs when you are making horizontal dumps that would normally have to be shrunk to fit on the page. In this case you may want to use a higher density to prevent the need for shrinking. A second exception occurs when you are simulating colours when making an EGA dump, as colour simulation is available only in densities >1. 24pin: only if you have a 24 pin matrix printer can you set the density to oddDensity to generate triple density 24 pin dumps of EGA screens. For non-EGA screens the density will default to double. Restrictions oddDensity can only be used with a 24 pin printer (NEC compatible) or with a laser printer. Some versions of FASTPROC do not support 24 pin printers. See also FPGetDensity, FPSetColour, FASTDUMP manual Example -------------------------------------------------------- FPGetDensity function -------------------------------------------------------- Function returns the printing density for graphics dumps Declaration in Pascal function FPGetDensity : dump_densities; BASIC DECLARE FUNCTION FPGetDensity% C dump_densities far pascal FPGetDensity(); Result type (Pascal:) dump_densities (BASIC:) integer (C:) dump_densities Remarks (Pascal:) type dump_densities=(singleDensity,doubleDensity, odddensity,quadDensity); (BASIC:) the constants SINGLEDENSITY%, DOUBLEDENSITY%, ODDDENSITY%, QUADDENSITY% have been assigned the appropriate values (C:) typedef enum { <>, singleDensity, doubleDensity, odddensity, quadDensity } dump_densities; Restrictions See also FPSetDensity, FASTDUMP manual Example -------------------------------------------------------- FPSetInvert procedure -------------------------------------------------------- Function instructs FASTPROC to invert or not invert black and white in graphics screen dumps Declaration in Pascal procedure FPSetInvert(todoornottodo : boolean); BASIC DECLARE SUB FPSetInvert(BYVAL todo%) C void far pascal FPSetInvert(int yesorno); Result type Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values By default, FASTPROC will print (in black), everything that is white on your screen. If you want what's black to be black, and are either deaf or have an uncommonly quiet printer, you may instruct FASTPROC to make what's black black by issuing FPSETINVERT(TRUE) Restrictions when a colour printer is being used this command does not affect the way red, yellow and blue are printed See also FPGetInvert, FASTDUMP manual Example -------------------------------------------------------- FPGetInvert function -------------------------------------------------------- Function returns true if FASTPROC will invert black and white in graphics screen dumps Declaration in Pascal function FPGetInvert : boolean; BASIC DECLARE FUNCTION FPGetInvert% C int far pascal FPGetInvert(); Result type (Pascal:) boolean (BASIC:) integer (C:) int Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values Restrictions when a colour printer is being used this command does not affect the way red, yellow and blue are printed See also FPSetInvert, FASTDUMP manual Example -------------------------------------------------------- FPSetFormfeed procedure -------------------------------------------------------- Function instruct FASTPROC to issue or not issue a formfeed to the printer after a graphics screen dump Declaration in Pascal procedure FPSetFormFeed(todoornottodo : boolean); BASIC DECLARE SUB FPSetFormFeed(BYVAL todo%) C void far pascal FPSetFormFeed(int yesorno); Result type Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values Restrictions only has an effect on graphics screen dumps See also FPGetFormfeed, FASTDUMP manual Example -------------------------------------------------------- FPGetFormfeed function -------------------------------------------------------- Function returns true if FASTPROC is to issue a formfeed to the printer after a graphics screen dump Declaration in Pascal function FPGetFormFeed : boolean; BASIC DECLARE FUNCTION FPGetFormFeed% C int far pascal FPGetFormFeed(); Result type (Pascal:) boolean (BASIC:) integer (C:) int Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values Restrictions See also FPSetFormfeed, FASTDUMP manual Example -------------------------------------------------------- FPSetPort procedure -------------------------------------------------------- Function select which printer port to send output to Declaration in Pascal procedure FPSetPort(which : dump_ports); BASIC DECLARE SUB FPSetPort(BYVAL which%) C void far pascal FPSetPort(dump_ports which); Result type Remarks (Pascal:) type dump_ports=(lpt1,lpt2,lpt3); (BASIC:) the constants LPT1%, LPT2%, LPT3% have been assigned the appropriate values (C:) typedef enum { <>, lpt1, lpt2, lpt3 } dump_ports If you try to select a port that is not found on the computer being used the command is ignored Restrictions ports to be selected should be present in the computer or the command will be ignored See also FPGetPort, FASTDUMP manual Example -------------------------------------------------------- FPGetPort function -------------------------------------------------------- Function returns which printer port output will be sent to Declaration in Pascal function FPGetPort : dump_ports; BASIC DECLARE FUNCTION FPGetPort% C dump_ports far pascal FPGetPort(); Result type (Pascal:) dump_ports (BASIC:) integer (C:) dump_ports Remarks (Pascal:) type dump_ports=(lpt1,lpt2,lpt3); (BASIC:) the constants LPT1%, LPT2%, LPT3% have been assigned the appropriate values (C:) typedef enum { <>, lpt1, lpt2, lpt3 } dump_ports Restrictions See also FPSetPort, FASTDUMP manual Example -------------------------------------------------------- FPSetOrientation procedure -------------------------------------------------------- Function select the orientation of graphics dumps on the printer paper Declaration in Pascal procedure FPSetOrientation(which : dump_orientations); BASIC DECLARE SUB FPSetOrientation(BYVAL which%) C void far pascal FPSetOrientation( dump_orientations which); Result type Remarks (Pascal:) type dump_orientation=(dump_horizontal, dump_optimum,dump_left,dump_right); (BASIC:) the constants HORIZONTAL%,OPTIMUM%,LEFT%,RIGHT% have been asigned the appropriate values (C:) typedef enum { dump_horizontal, dump_optimum, dump_left, dump_right } dump_orientations; The meaning of the possible orientations: horizontal same as with printed text optimum left or right, whichever dumps faster left lower axis of dump is along left edge of printer paper right lower axis of dump is along right edge of printer paper Restrictions See also FPGetOrientation, FASTDUMP manual Example -------------------------------------------------------- FPGetOrientation function -------------------------------------------------------- Function returns the orientation of graphics dumps on the printer paper Declaration in Pascal function FPGetOrientation : dump_orientations; BASIC DECLARE FUNCTION FPGetOrientation% C dump_orientations far pascal FPGetOrientation(); Result type (Pascal:) dump_orientations (BASIC:) integer (C:) dump_orientations Remarks (Pascal:) type dump_orientation=(dump_horizontal, dump_optimum,dump_left,dump_right); (BASIC:) the constants HORIZONTAL%,OPTIMUM%,LEFT%,RIGHT% have been asigned the appropriate values (C:) typedef enum { dump_horizontal, dump_optimum, dump_left, dump_right } dump_orientations; The meaning of the possible orientations: The meaning of the possible orientations: horizontal same as with printed text optimum left or right, whichever dumps faster left lower axis of dump is along left edge of printer paper right lower axis of dump is along right edge of printer paper Restrictions See also FPSetOrientation, FASTDUMP manual Example -------------------------------------------------------- FPSetShrink procedure -------------------------------------------------------- Function select shrinking mode Declaration in Pascal procedure FPSetShrink(which : dump_shrinkmode); BASIC DECLARE SUB FPSetShrink(BYVAL which%) C void far pascal FPSetShrink(dump_shrinkmode which); Result type Remarks (Pascal:) type dump_shrinkmode=(autoshrink,noshrink, shrink1,shrink2,shrink3); (BASIC:) the constants AUTOSHRINK%, NOSHRINK%, SHRINK1%, SHRINK2%, SHRINK3% have been assigned the appropriate values (C:) typedef enum { noshrink, shrink1, shrink2, shrink3, autoshrink } dump_shrinkmode; When horizontal graphics dumps are being made the image will sometimes have to be shrunk (in the horizontal direction) to fit on standard 8" paper. If however you are using a 15" wide printer you need not use shrinking. For these reasons the following shrink modes are available: autoshrink use minimum shrinking, but enough to make dump less than 8" wide Exception: if the density is set to double or quadruple instead of shrinking the extra available bytes are used noshrink don't shrink shrink1 shrink by 50% shrink2 by 33% shrink3 by 25% Restrictions See also FPGetShrink, FASTDUMP manual Example -------------------------------------------------------- FPGetShrink function -------------------------------------------------------- Function returns the shrinking mode FASTPROC is currently using for horizontal dumps Declaration in Pascal function FPGetShrink : dump_shrinkmode; BASIC DECLARE FUNCTION FPGetShrink% C dump_shrinkmode far pascal FPGetShrink(); Result type (Pascal:) dump_shrinkmode (BASIC:) integer (C:) dump_shrinkmode Remarks (Pascal:) type dump_shrinkmode=(autoshrink,noshrink, shrink1,shrink2,shrink3); (BASIC:) the constants AUTOSHRINK%, NOSHRINK%, SHRINK1%, SHRINK2%, SHRINK3% have been assigned the appropriate values (C:) typedef enum { noshrink, shrink1, shrink2, shrink3, autoshrink } dump_shrinkmode; Restrictions See also FPSetShrink, FASTDUMP manual Example -------------------------------------------------------- FPSetCentered procedure -------------------------------------------------------- Function instruct FASTPROC to center or not center horizontal dumps on the printer paper Declaration in Pascal procedure FPSetCentered(todoornottodo : boolean); BASIC DECLARE SUB FPSetCentered(BYVAL todo%) C void far pascal FPSetCentered(int yesorno); Result type Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values Restrictions See also FPGetCentered, FASTDUMP manual Example -------------------------------------------------------- FPGetCentered function -------------------------------------------------------- Function returns true if FASTPROC will center horizontal dumps on the printer paper Declaration in Pascal function FPGetCentered : boolean; BASIC DECLARE SUB FPGetCentered% C int far pascal FPGetCentered(); Result type (Pascal:) boolean (BASIC:) integer Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values Restrictions See also FPSetCentered, FASTDUMP manual Example -------------------------------------------------------- FPSetWindow procedure -------------------------------------------------------- Function limits the window that will be printed to part of the video screen Declaration in Pascal procedure FPSetWindow(x0,y0,x1,y1 : word); BASIC DECLARE SUB FPSetWindow(BYVAL x0%,BYVAL y0%, BYVAL x1%,BYVAL y1%) C void far pascal FPSetWindow( unsigned short x0, unsigned short y0, unsigned short x1, unsigned short y1); Result type Remarks for the purpose of window selection the video screen is treated as a text screen (even for graphics modes), with x coordinates 1..80 and y coordinates 1..25 (or 1..43/50 for EGA/VGA text displays). Window coordinates outside these ranges will be ignored. If x1<$> 1/60" tabulation The default compression mode is 3. Note that some printers only support <$> in NLQ mode. FASTPROC does not set the printer to NLQ, so you should take care of that yourself in your program. UPDATE INFORMATION The /z command is also used to indicate which Laser Printer compression techniques may be used. The codes are code technique 16 use ESC*b#Y to emit empty lines 32 use TIFF version 4 compression 64 use delta row compression These compression techniques are available in modern Laser Printers like the HP Laserjet III, but not in earlier models like the HP Laserjet I. Restrictions See also FPGetCompressMode, FASTDUMP manual Example -------------------------------------------------------- FPGetCompressmode function -------------------------------------------------------- Function returns the compression mode currently used to minimize the amount of data sent to the printer when making a dump Declaration in Pascal function FPGetCompressMode : integer; BASIC DECLARE FUNCTION FPGetCompressMode% C int far pascal FPGetCompressMode(); Result type integer Remarks it is possible to compress printed data by substituting spaces for long ranges of zero graphics data. On some printers tabs or exact dot tabulations may also be used. Which type of compression is used is determined by the compression mode. The compression mode is the sum of the codes for any of four compression techniques you want to use: code technique 1 substitute spaces for empty graphics 2 use enlarged spaces (and tabs) 4 substitute tabs for empty graphics 8 use <$> 1/60" tabulation The default compression mode is 3. Note that some printers only support <$> in NLQ mode. FASTPROC does not set the printer to NLQ, so you should take care of that yourself in your program Restrictions See also FPSetCompressMode, FASTDUMP manual Example -------------------------------------------------------- FPSetCR procedure -------------------------------------------------------- Function instruct FASTPROC to issue or not issue a carriage return in addition to a line feed to start a new line. A CR is required on some printers, e.g. Laser Printers (if you issue FPSetColour(dump_laser) an FPSetCR(true) is issued as a side-effect). Declaration in Pascal procedure FPSetCR(todoornottodo : boolean); BASIC DECLARE SUB FPSetCR(BYVAL todo%) C void far pascal FPSetCR(int yesorno); Result type Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values Restrictions See also FPGetCR, FASTDUMP manual Example -------------------------------------------------------- FPGetCR function -------------------------------------------------------- Function returns true if FASTPROC is to issue a carriage return in addition to a line feed to start a new line Declaration in Pascal function FPGetCR : boolean; BASIC DECLARE FUNCTION FPGetCR% C int far pascal FPGetCR(); Result type (Pascal:) boolean (BASIC:) integer (C:) int Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values Restrictions See also FPSetCR, FASTDUMP manual Example -------------------------------------------------------- FPSetNul procedure -------------------------------------------------------- Function to make FASTPROC ignore all calls to PrintScreen and PrintScreen2Disk until further order Declaration in Pascal procedure FPSetNul(todoornottodo : boolean); BASIC DECLARE SUB FPSetNul(BYVAL todo%) C void far pascal FPSetNul(int yesorno); Result type Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values If you issue FPSETNUL(TRUE) FASTPROC will not generate any output (to printer or disk) until you issue FPSETNUL(FALSE) (this situation is identical to switching the printer off-line as far as PrintScreen is concerned) Restrictions See also FPGetNul, FASTDUMP manual Example -------------------------------------------------------- FPGetNul function -------------------------------------------------------- Function returns true if FASTPROC will ignore all calls to PrintScreen and PrintScreen2Disk until further order Declaration in Pascal function FPGetNul : boolean; BASIC DECLARE FUNCTION FPGetNul% C int far pascal FPGetNul(); Result type (Pascal:) boolean (BASIC:) integer (C:) int Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values Restrictions See also FPSetNul, FASTDUMP manual Example -------------------------------------------------------- FPGetOutputcount function -------------------------------------------------------- Function returns the number of bytes sent to the printer or print file in the last screen dump Declaration in Pascal function FPGetOutputcount : word; BASIC DECLARE FUNCTION FPGetOutputcount% C unsigned short far pascal FPGetOutputcount(); Result type (Pascal:) word (BASIC:) integer (C:) unsigned short Remarks Restrictions not available in FASTDUMP; included here mainly for demonstration purposes See also Example -------------------------------------------------------- FPGetInterrupted function -------------------------------------------------------- Function returns true if FASTPROC was interrupted by pressing the ESC key Declaration in Pascal function FPGetInterrupted : boolean; BASIC DECLARE FUNCTION FPGetInterrupted% C int far pascal FPGetInterrupted(); Result type (Pascal:) boolean (BASIC:) integer (C:) int Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values This procedure allows you to take some action if a dump is interrupted by the user Restrictions See also Example -------------------------------------------------------- FPSetText procedure -------------------------------------------------------- Function instructs FASTPROC to assume Hercules display is in text mode Declaration in Pascal procedure FPSetText; BASIC DECLARE SUB FPSetText C void far pascal FPSetText(); Result type Remarks there is no easy way to determine if a hercules adaptor is displaying text or graphics. We have included an analysis algorithm in FASTPROC that nevertheless hasn't been known to get it wrong once. Still, if you want to make absolutely sure text will be dumped you may use this procedure Restrictions only significant on a hercules adaptor See also FPGetText, FPSetGraph, FPSetAuto, FASTDUMP manual Example -------------------------------------------------------- FPGetText function -------------------------------------------------------- Function returns true if FASTPROC assumes Hercules display is in text mode (and analysis algorithm will not be used) Declaration in Pascal function FPGetText : boolean; BASIC DECLARE FUNCTION FPGetText% C int far pascal FPGetText(); Result type (Pascal:) boolean (BASIC:) integer (C:) int Remarks there is no easy way to determine if a hercules adaptor is displaying text or graphics. We have included an analysis algorithm in FASTPROC that nevertheless hasn't been known to get it wrong once. The analysis algorithm may be disabled using FPSetAuto(false), FPSetText or FPSetGraph. You may then use FPGetText to see if text will be dumped Restrictions only significant on a hercules adaptor See also FPSetText, FPGetGraph, FPGetAuto, FASTDUMP manual Example -------------------------------------------------------- FPSetGraph procedure -------------------------------------------------------- Function instructs FASTPROC to assume Hercules display is in graphics mode Declaration in Pascal procedure FPSetGraph; BASIC DECLARE SUB FPSetGraph C void far pascal FPSetGraph(); Result type Remarks there is no easy way to determine if a hercules adaptor is displaying text or graphics. We have included an analysis algorithm in FASTPROC that nevertheless hasn't been known to get it wrong once. Still, if you want to make absolutely sure graphics will be dumped you may use this procedure Restrictions See also FPGetGraph, FPSetText, FPSetAuto, FASTDUMP manual Example -------------------------------------------------------- FPGetGraph function -------------------------------------------------------- Function returns if FASTPROC will assume Hercules display is in graphics mode Declaration in Pascal function FPGetGraph : boolean; BASIC DECLARE FUNCTION FPGetGraph% C int far pascal FPGetGraph(); Result type (Pascal:) boolean (BASIC:) integer (C:) int Remarks there is no easy way to determine if a hercules adaptor is displaying text or graphics. We have included an analysis algorithm in FASTPROC that nevertheless hasn't been known to get it wrong once. The analysis algorithm may be disabled using FPSetAuto(false), FPSetText or FPSetGraph. You may then use FPGetGraph to see if graphics will be dumped Restrictions See also FPSetGraph, FPGetText, FPGetAuto, FASTDUMP manual Example -------------------------------------------------------- FPSetAuto procedure -------------------------------------------------------- Function instruct FASTPROC to use or not use its analysis algorithm to determine if text or graphics are being displayed on a hercules adaptor Declaration in Pascal procedure FPSetAuto(todoornottodo : boolean); BASIC DECLARE SUB FPSetAuto(BYVAL todo%) C void far pascal FPSetAuto(int yesorno); Result type Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values There is no easy way to determine if a hercules adaptor is displaying text or graphics. We have included an analysis algorithm in FASTPROC that nevertheless hasn't been known to get it wrong once. By default this algorithm is used. However, if you have issued a call to FPSetText or FPSetGraph to force text or graphics dumps, the analysis algorithm has been disabled. To enable it again use FPSETAUTO(TRUE) Restrictions only significant on a hercules adaptor See also FPGetAuto, FPSetText, FPSetGraph, FASTDUMP manual Example -------------------------------------------------------- FPGetAuto function -------------------------------------------------------- Function returns true if FASTPROC will use its analysis algorithm to determine if text or graphics are being displayed on a hercules adaptor Declaration in Pascal function FPGetAuto : boolean; BASIC DECLARE FUNCTION FPGetAuto% C int far pascal FPGetAuto(); Result type (Pascal:) boolean (BASIC:) integer (C:) int Remarks (BASIC:) the constants TRUE%, FALSE% have been assigned the appropriate values There is no easy way to determine if a hercules adaptor is displaying text or graphics. We have included an analysis algorithm in FASTPROC that nevertheless hasn't been known to get it wrong once. By default this algorithm is used. However, if you have issued a call to FPSetText, FPSetGraph, or FPSetAuto(false) to force text or graphics dumps, the analysis algorithm has been disabled. To see if this is the case check the value returned by FPGetAuto Restrictions only significant on a hercules adaptor See also FPSetAuto, FPGetText, FPGetGraph, FASTDUMP manual Example -------------------------------------------------------- FPSetPage procedure -------------------------------------------------------- Function select which page to take data from on a hercules adaptor Declaration in Pascal procedure FPSetPage(which : dump_pages); BASIC DECLARE SUB FPSetPage(BYVAL which%) C void far pascal FPSetPage(dump_pages which); Result type Remarks (Pascal:) type dump_pages=(page0,page1); (BASIC:) the constants PAGE0%, PAGE1% have been assigned the appropriate values typedef enum { page0, page1 } dump_pages; A Hercules adaptor contains two data areas which it can display on the screen. In order to dump what is currently being displayed the appropriate area needs to be selected. By default (and in most applications) this is page0. Of course when you are using FASTPROC you yourself have full control over which area is being used, and you should configure FASTPROC accordingly Restrictions only significant on a hercules adaptor See also FPGetPage, FASTDUMP manual Example -------------------------------------------------------- FPGetPage function -------------------------------------------------------- Function returns which page data are taken from on a hercules adaptor Declaration in Pascal function FPGetPage : dump_pages; BASIC DECLARE FUNCTION FPGetPage% C dump_pages far pascal FPGetPage(); Result type (Pascal:) dump_pages (BASIC:) integer (C:) dump_pages Remarks (Pascal:) type dump_pages=(page0,page1); (BASIC:) the constants PAGE0%, PAGE1% have been assigned the appropriate values typedef enum { page0, page1 } dump_pages; A Hercules adaptor contains two data areas which it can display on the screen. In order to dump what is currently being displayed the appropriate area needs to be selected. By default (and in most applications) this is page0. Of course when you are using FASTPROC you yourself have full control over which area is being used, and you should configure FASTPROC accordingly. You may use FPGetPage to see which page is currently selected Restrictions only significant on a hercules adaptor See also FPSetPage, FASTDUMP manual Example SUPPORTED SCREEN MODES FASTPROC will dump the following types of screens: On a CGA: all modes, viz. 0,1 40*25 16-colour alphanumeric 2,3 80*25 16-colour alphanumeric 4,5 320*200 4-colour graphics 6 640*200 2-colour graphics On a HGC: 7 80*25 2-colour alphanumeric or 720*350 2-colour graphics, with optional text/graphics mode detection On an EGA: all colour modes, viz. all CGA modes (including 43 line text) 0Dh 320*200 16-colour graphics (reduced size dump) 0Eh 640*200 16-colour graphics 10h 640*350 16-colour graphics On a VGA: all colour modes except 13h (320*200 256-colour graphics), viz. all EGA modes (including 50 line text) 11h 640*480 2-colour graphics 12h 640*480 16-colour graphics On an AT&T 6300: all modes, viz. all CGA modes 40h 640*400 2-colour graphics On an OEC & monochrome adaptor (Olivetti M240,M280): all colour modes, viz. all CGA modes all AT&T 6300 modes all EGA modes PRINTERS SUPPORTED BY FASTPROC FASTPROC supports IBM graphics printers, IBM Proprinter II, IBM Proprinter X24, NEC P6, NEC P7, and Epson FX,MX,RX and compatible printers. It also supports HP Lserjety II and higher printers (using PCL5 printer command language). LIMITATIONS FASTDUMP requires the printer to be set up to automatically generate a carriage return each time a line feed is received, and not to generate a line feed when a carriage return is received. These things are generally set up by setting DIP switches in the printer. If you cannot set up your printer this way, use the FPSetCR procedure to indicate to FASTPROC that it needs to explicitly generate carriage return commands. OVERVIEW OF FILES ON THE DISTRIBUTION DISK FASTPROC.H header file for C programs FASTPR24.OBJ object file to be linked to C objects FASTPROC.PAS source of Turbo/Quick Pascal unit FASTPROC.TPI interface section of Turbo Pascal unit TCEXAMPL.C C example TPEXAMPL.PAS Turbo Pascal example DISCLAIMER The author cannot be held liable for damages of any kind resulting from the use of this product. The product is provided on an 'as is' basis, without any guarantee that it will work on a particular computer. COPYRIGHT You are free to distribute FASTPROC to other users, provided you distribute all the files in the package. FASTPROC may, however, not be distributed as part of a commercial product without prior consent of the author. If you are working in a company, and want to use FASTPROC in a commercial application, you need to register. REGISTRATION To register send a cheque or money order for $50 to Peter van Mierlo Liesbergstraat 9 5628 ED Eindhoven The Netherlands fax + 31 40 411 945 email 100272.3606@Compuserve.com Compuserve members can register FASTPROC on-line. GO SWREG and follow the directions there. The registration ID for FASTPROC is 5986. Companies that intend to use FASTPROC in commercial applications can obtain a royalty-free site license of FASTPROC for $300. This includes a site license for FASTDUMP. Please contact the author if you wish to obtain a site license. FILES IN THIS PACKAGE FASTPROC.TXT this manual FASTPROC.DOC this manual (Word for Windows 6 format) FASTDEMO.EXE example program demonstrating FASTPROC/FASTDUMP QUILT.PCX example graphic QUILT.HLP help file for FASTDEMO QUILT.PAG help file index FASTDUMP.TXT documentation on FASTDUMP README.TXT some explanation C\FASTPROC.H header file defining prototypes C\FASTPR23.OBJ actual dumping code C\TCEXAMPL.C example file C\TCEXAMPL.OBJ compiled example file C\TCEXAMPL.EXE compiled example file C\TCEXAMPL.PRJ Borland C 3.1 project file TPASCAL\FASTPR24.OBJ turbo pascal style dumping code TPASCAL\FASTPR24.PAS dump unit implementation TPASCAL\FASTPR24.TPI dump unit interface TPASCAL\TPEXAMPL.PAS example file TPASCAL\FASTPR24.TPU compiled dump unit TPASCAL\FASTDEMO.PAS partial source to FASTDEMO TPASCAL\TPEXAMPL.EXE compiled example file TPASCAL\COMPILE.BAT compile script MSPASCAL\FASTPR23.OBJ microsoft style dumping code MSPASCAL\FASTPROC.ITF interface definitions for dump unit MSPASCAL\FASTPROC.PAS implemetation of dump unit MSPASCAL\FASTPROC.OBJ compiled dump unit MSPASCAL\MSPEXAMP.PAS example source MSPASCAL\MSPEXAMP.OBJ compiled example MSPASCAL\MSPEXAMP.EXE compiled and linked example MSPASCAL\COMPILE.BAT compile script QBASIC\FASTPROC.BAS definitions of procedures QBASIC\FASTPR23.OBJ dumping code QBASIC\QBEXAMPL.BAS example file